package com.caozhi.mspeoject.nb_search.repository;

import com.woniuxy.boot.common.bean.EsUser;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface UserSearchRepository extends ElasticsearchRepository<EsUser, Long> {
    @Query("{\"bool\": {\"should\": [{\"term\": {\"name\": ?0}}, {\"term\": {\"phone\": ?1}},{\"term\": {\"idCard\": ?1}}], \"minimum_should_match\": 1}}")
    List<EsUser> findByNameOrPhoneOrIdCard(String name , String phone, String idCard);
}
